.class public Lcom/example/zsccpsapp/SlideMenu;
.super Landroid/view/ViewGroup;
.source "SlideMenu.java"


# static fields
.field private static final SCREEN_INVALID:I = -0x1

.field public static final SCREEN_MAIN:I = 0x1

.field public static final SCREEN_MENU:I = 0x0

.field private static final SNAP_VELOCITY:I = 0x3e8

.field private static final TOUCH_STATE_REST:I = 0x0

.field private static final TOUCH_STATE_SCROLLING:I = 0x1


# instance fields
.field private mAllowLongPress:Z

.field private mCurrentScreen:I

.field private mLastMotionX:F

.field private mLastMotionY:F

.field private mLocked:Z

.field private mNextScreen:I

.field private mScroller:Landroid/widget/Scroller;

.field private mTouchSlop:I

.field public mTouchState:I

.field private mVelocityTracker:Landroid/view/VelocityTracker;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 37
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-direct {p0, p1, v0, v1}, Lcom/example/zsccpsapp/SlideMenu;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 38
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;

    .prologue
    .line 41
    const/4 v0, 0x0

    invoke-direct {p0, p1, p2, v0}, Lcom/example/zsccpsapp/SlideMenu;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 42
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "attrs"    # Landroid/util/AttributeSet;
    .param p3, "defStyle"    # I

    .prologue
    .line 45
    invoke-direct {p0, p1, p2, p3}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    .line 19
    const/4 v0, -0x1

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mNextScreen:I

    .line 32
    const/4 v0, 0x0

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    .line 47
    new-instance v0, Landroid/widget/Scroller;

    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/Scroller;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    .line 48
    const/4 v0, 0x1

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    .line 49
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledTouchSlop()I

    move-result v0

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchSlop:I

    .line 50
    return-void
.end method


# virtual methods
.method clearChildrenCache()V
    .locals 4

    .prologue
    .line 177
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v0

    .line 178
    .local v0, "count":I
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    if-lt v1, v0, :cond_0

    .line 182
    return-void

    .line 179
    :cond_0
    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 180
    .local v2, "layout":Landroid/view/View;
    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Landroid/view/View;->setDrawingCacheEnabled(Z)V

    .line 178
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method public closeMenu()V
    .locals 1

    .prologue
    .line 350
    const/4 v0, 0x1

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    .line 351
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    invoke-virtual {p0, v0}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    .line 352
    return-void
.end method

.method public computeScroll()V
    .locals 4

    .prologue
    const/4 v3, -0x1

    .line 266
    iget-object v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v0}, Landroid/widget/Scroller;->computeScrollOffset()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 267
    iget-object v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v0}, Landroid/widget/Scroller;->getCurrX()I

    move-result v0

    iget-object v1, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v1}, Landroid/widget/Scroller;->getCurrY()I

    move-result v1

    invoke-virtual {p0, v0, v1}, Lcom/example/zsccpsapp/SlideMenu;->scrollTo(II)V

    .line 274
    :cond_0
    :goto_0
    return-void

    .line 268
    :cond_1
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mNextScreen:I

    if-eq v0, v3, :cond_0

    .line 269
    const/4 v0, 0x0

    .line 270
    iget v1, p0, Lcom/example/zsccpsapp/SlideMenu;->mNextScreen:I

    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    invoke-static {v1, v2}, Ljava/lang/Math;->min(II)I

    move-result v1

    .line 269
    invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I

    move-result v0

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    .line 271
    iput v3, p0, Lcom/example/zsccpsapp/SlideMenu;->mNextScreen:I

    .line 272
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->clearChildrenCache()V

    goto :goto_0
.end method

.method protected dispatchDraw(Landroid/graphics/Canvas;)V
    .locals 3
    .param p1, "canvas"    # Landroid/graphics/Canvas;

    .prologue
    .line 284
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v0

    .line 285
    .local v0, "scrollX":I
    invoke-super {p0, p1}, Landroid/view/ViewGroup;->dispatchDraw(Landroid/graphics/Canvas;)V

    .line 286
    int-to-float v1, v0

    const/4 v2, 0x0

    invoke-virtual {p1, v1, v2}, Landroid/graphics/Canvas;->translate(FF)V

    .line 287
    return-void
.end method

.method public dispatchUnhandledMove(Landroid/view/View;I)Z
    .locals 3
    .param p1, "focused"    # Landroid/view/View;
    .param p2, "direction"    # I

    .prologue
    const/4 v0, 0x1

    .line 291
    const/16 v1, 0x11

    if-ne p2, v1, :cond_0

    .line 292
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getCurrentScreen()I

    move-result v1

    if-lez v1, :cond_1

    .line 293
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getCurrentScreen()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    .line 302
    :goto_0
    return v0

    .line 296
    :cond_0
    const/16 v1, 0x42

    if-ne p2, v1, :cond_1

    .line 297
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getCurrentScreen()I

    move-result v1

    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-ge v1, v2, :cond_1

    .line 298
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getCurrentScreen()I

    move-result v1

    add-int/lit8 v1, v1, 0x1

    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    goto :goto_0

    .line 302
    :cond_1
    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->dispatchUnhandledMove(Landroid/view/View;I)Z

    move-result v0

    goto :goto_0
.end method

.method enableChildrenCache()V
    .locals 4

    .prologue
    .line 169
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v0

    .line 170
    .local v0, "count":I
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    if-lt v1, v0, :cond_0

    .line 174
    return-void

    .line 171
    :cond_0
    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 172
    .local v2, "layout":Landroid/view/View;
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/view/View;->setDrawingCacheEnabled(Z)V

    .line 170
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method public getCurrentScreen()I
    .locals 1

    .prologue
    .line 337
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    return v0
.end method

.method public isMainScreenShowing()Z
    .locals 2

    .prologue
    const/4 v0, 0x1

    .line 341
    iget v1, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    if-ne v1, v0, :cond_0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public lock()V
    .locals 1

    .prologue
    .line 359
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mLocked:Z

    .line 360
    return-void
.end method

.method public measureViews(II)V
    .locals 4
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    .line 59
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    .line 60
    .local v1, "menuView":Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v2

    iget v2, v2, Landroid/view/ViewGroup$LayoutParams;->width:I

    invoke-virtual {v1}, Landroid/view/View;->getLeft()I

    move-result v3

    add-int/2addr v2, v3

    .line 61
    invoke-virtual {v1}, Landroid/view/View;->getRight()I

    move-result v3

    add-int/2addr v2, v3

    .line 60
    invoke-virtual {v1, v2, p2}, Landroid/view/View;->measure(II)V

    .line 63
    const/4 v2, 0x1

    invoke-virtual {p0, v2}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 64
    .local v0, "contentView":Landroid/view/View;
    invoke-virtual {v0, p1, p2}, Landroid/view/View;->measure(II)V

    .line 65
    return-void
.end method

.method protected onFinishInflate()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 86
    invoke-super {p0}, Landroid/view/ViewGroup;->onFinishInflate()V

    .line 88
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v2

    if-lt v1, v2, :cond_0

    .line 93
    return-void

    .line 89
    :cond_0
    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    .line 90
    .local v0, "child":Landroid/view/View;
    invoke-virtual {v0, v3}, Landroid/view/View;->setFocusable(Z)V

    .line 91
    invoke-virtual {v0, v3}, Landroid/view/View;->setClickable(Z)V

    .line 88
    add-int/lit8 v1, v1, 0x1

    goto :goto_0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 12
    .param p1, "ev"    # Landroid/view/MotionEvent;

    .prologue
    const/4 v10, 0x0

    const/4 v11, 0x1

    .line 97
    iget-boolean v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mLocked:Z

    if-eqz v9, :cond_1

    .line 165
    :cond_0
    :goto_0
    return v11

    .line 101
    :cond_1
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    .line 102
    .local v0, "action":I
    const/4 v9, 0x2

    if-ne v0, v9, :cond_2

    .line 103
    iget v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    if-nez v9, :cond_0

    .line 107
    :cond_2
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v3

    .line 108
    .local v3, "x":F
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v6

    .line 110
    .local v6, "y":F
    packed-switch v0, :pswitch_data_0

    .line 165
    :cond_3
    :goto_1
    iget v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    if-nez v9, :cond_0

    move v11, v10

    goto :goto_0

    .line 113
    :pswitch_0
    iget v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionX:F

    sub-float v9, v3, v9

    invoke-static {v9}, Ljava/lang/Math;->abs(F)F

    move-result v9

    float-to-int v4, v9

    .line 114
    .local v4, "xDiff":I
    iget v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionY:F

    sub-float v9, v6, v9

    invoke-static {v9}, Ljava/lang/Math;->abs(F)F

    move-result v9

    float-to-int v7, v9

    .line 116
    .local v7, "yDiff":I
    iget v2, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchSlop:I

    .line 117
    .local v2, "touchSlop":I
    if-le v4, v2, :cond_6

    move v5, v11

    .line 118
    .local v5, "xMoved":Z
    :goto_2
    if-le v7, v2, :cond_7

    move v8, v11

    .line 120
    .local v8, "yMoved":Z
    :goto_3
    if-nez v5, :cond_4

    if-eqz v8, :cond_3

    .line 122
    :cond_4
    if-eqz v5, :cond_5

    .line 124
    iput v11, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    .line 125
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->enableChildrenCache()V

    .line 128
    :cond_5
    iget-boolean v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mAllowLongPress:Z

    if-eqz v9, :cond_3

    .line 129
    iput-boolean v10, p0, Lcom/example/zsccpsapp/SlideMenu;->mAllowLongPress:Z

    .line 135
    iget v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    invoke-virtual {p0, v9}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    .line 136
    .local v1, "currentScreen":Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->cancelLongPress()V

    goto :goto_1

    .end local v1    # "currentScreen":Landroid/view/View;
    .end local v5    # "xMoved":Z
    .end local v8    # "yMoved":Z
    :cond_6
    move v5, v10

    .line 117
    goto :goto_2

    .restart local v5    # "xMoved":Z
    :cond_7
    move v8, v10

    .line 118
    goto :goto_3

    .line 143
    .end local v2    # "touchSlop":I
    .end local v4    # "xDiff":I
    .end local v5    # "xMoved":Z
    .end local v7    # "yDiff":I
    :pswitch_1
    iput v3, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionX:F

    .line 144
    iput v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionY:F

    .line 145
    iput-boolean v11, p0, Lcom/example/zsccpsapp/SlideMenu;->mAllowLongPress:Z

    .line 147
    iget-object v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v9}, Landroid/widget/Scroller;->isFinished()Z

    move-result v9

    if-eqz v9, :cond_8

    move v9, v10

    :goto_4
    iput v9, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    goto :goto_1

    :cond_8
    move v9, v11

    .line 148
    goto :goto_4

    .line 155
    :pswitch_2
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->clearChildrenCache()V

    .line 156
    iput v10, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    .line 157
    iput-boolean v10, p0, Lcom/example/zsccpsapp/SlideMenu;->mAllowLongPress:Z

    goto :goto_1

    .line 110
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_2
        :pswitch_0
        :pswitch_2
    .end packed-switch
.end method

.method protected onLayout(ZIIII)V
    .locals 7
    .param p1, "changed"    # Z
    .param p2, "l"    # I
    .param p3, "t"    # I
    .param p4, "r"    # I
    .param p5, "b"    # I

    .prologue
    const/4 v6, 0x0

    .line 69
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v0

    .line 70
    .local v0, "childCount":I
    const/4 v4, 0x2

    if-eq v0, v4, :cond_0

    .line 71
    new-instance v4, Ljava/lang/IllegalStateException;

    .line 72
    const-string v5, "The childCount of SlidingMenu must be 2"

    .line 71
    invoke-direct {v4, v5}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v4

    .line 75
    :cond_0
    invoke-virtual {p0, v6}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    .line 76
    .local v2, "menuView":Landroid/view/View;
    invoke-virtual {v2}, Landroid/view/View;->getMeasuredWidth()I

    move-result v3

    .line 77
    .local v3, "width":I
    neg-int v4, v3

    invoke-virtual {v2}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    invoke-virtual {v2, v4, v6, v6, v5}, Landroid/view/View;->layout(IIII)V

    .line 79
    const/4 v4, 0x1

    invoke-virtual {p0, v4}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    .line 80
    .local v1, "contentView":Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredWidth()I

    move-result v4

    .line 81
    invoke-virtual {v1}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    .line 80
    invoke-virtual {v1, v6, v6, v4, v5}, Landroid/view/View;->layout(IIII)V

    .line 82
    return-void
.end method

.method protected onMeasure(II)V
    .locals 0
    .param p1, "widthMeasureSpec"    # I
    .param p2, "heightMeasureSpec"    # I

    .prologue
    .line 54
    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->onMeasure(II)V

    .line 55
    invoke-virtual {p0, p1, p2}, Lcom/example/zsccpsapp/SlideMenu;->measureViews(II)V

    .line 56
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 10
    .param p1, "ev"    # Landroid/view/MotionEvent;

    .prologue
    const/16 v7, 0x3e8

    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 186
    iget-boolean v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mLocked:Z

    if-eqz v6, :cond_1

    .line 261
    :cond_0
    :goto_0
    return v9

    .line 190
    :cond_1
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    if-nez v6, :cond_2

    .line 191
    invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;

    move-result-object v6

    iput-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    .line 193
    :cond_2
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    invoke-virtual {v6, p1}, Landroid/view/VelocityTracker;->addMovement(Landroid/view/MotionEvent;)V

    .line 195
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    .line 196
    .local v0, "action":I
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v5

    .line 198
    .local v5, "x":F
    packed-switch v0, :pswitch_data_0

    goto :goto_0

    .line 204
    :pswitch_0
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v6}, Landroid/widget/Scroller;->isFinished()Z

    move-result v6

    if-nez v6, :cond_3

    .line 205
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {v6}, Landroid/widget/Scroller;->abortAnimation()V

    .line 209
    :cond_3
    iput v5, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionX:F

    goto :goto_0

    .line 212
    :pswitch_1
    iget v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    if-ne v6, v9, :cond_0

    .line 214
    iget v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionX:F

    sub-float/2addr v6, v5

    float-to-int v2, v6

    .line 215
    .local v2, "deltaX":I
    iput v5, p0, Lcom/example/zsccpsapp/SlideMenu;->mLastMotionX:F

    .line 217
    if-gez v2, :cond_4

    .line 218
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v6

    add-int/2addr v6, v2

    invoke-virtual {p0, v8}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v7

    invoke-virtual {v7}, Landroid/view/View;->getWidth()I

    move-result v7

    neg-int v7, v7

    if-lt v6, v7, :cond_0

    .line 219
    invoke-virtual {p0, v2, v8}, Lcom/example/zsccpsapp/SlideMenu;->scrollBy(II)V

    goto :goto_0

    .line 222
    :cond_4
    if-lez v2, :cond_0

    .line 224
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v6

    add-int/lit8 v6, v6, -0x1

    .line 223
    invoke-virtual {p0, v6}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v6

    .line 224
    invoke-virtual {v6}, Landroid/view/View;->getRight()I

    move-result v6

    .line 225
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v7

    .line 223
    sub-int/2addr v6, v7

    .line 225
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getWidth()I

    move-result v7

    .line 223
    sub-int v1, v6, v7

    .line 227
    .local v1, "availableToScroll":I
    if-lez v1, :cond_0

    .line 228
    invoke-static {v1, v2}, Ljava/lang/Math;->min(II)I

    move-result v6

    invoke-virtual {p0, v6, v8}, Lcom/example/zsccpsapp/SlideMenu;->scrollBy(II)V

    goto :goto_0

    .line 234
    .end local v1    # "availableToScroll":I
    .end local v2    # "deltaX":I
    :pswitch_2
    iget v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    if-ne v6, v9, :cond_5

    .line 235
    iget-object v3, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    .line 236
    .local v3, "velocityTracker":Landroid/view/VelocityTracker;
    invoke-virtual {v3, v7}, Landroid/view/VelocityTracker;->computeCurrentVelocity(I)V

    .line 237
    invoke-virtual {v3}, Landroid/view/VelocityTracker;->getXVelocity()F

    move-result v6

    float-to-int v4, v6

    .line 239
    .local v4, "velocityX":I
    if-le v4, v7, :cond_6

    iget v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    if-ne v6, v9, :cond_6

    .line 241
    invoke-virtual {p0, v8}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    .line 250
    :goto_1
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    if-eqz v6, :cond_5

    .line 251
    iget-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    invoke-virtual {v6}, Landroid/view/VelocityTracker;->recycle()V

    .line 252
    const/4 v6, 0x0

    iput-object v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mVelocityTracker:Landroid/view/VelocityTracker;

    .line 255
    .end local v3    # "velocityTracker":Landroid/view/VelocityTracker;
    .end local v4    # "velocityX":I
    :cond_5
    iput v8, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    goto/16 :goto_0

    .line 242
    .restart local v3    # "velocityTracker":Landroid/view/VelocityTracker;
    .restart local v4    # "velocityX":I
    :cond_6
    const/16 v6, -0x3e8

    if-ge v4, v6, :cond_7

    .line 243
    iget v6, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    if-nez v6, :cond_7

    .line 245
    invoke-virtual {p0, v9}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    goto :goto_1

    .line 247
    :cond_7
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->snapToDestination()V

    goto :goto_1

    .line 258
    .end local v3    # "velocityTracker":Landroid/view/VelocityTracker;
    .end local v4    # "velocityX":I
    :pswitch_3
    iput v8, p0, Lcom/example/zsccpsapp/SlideMenu;->mTouchState:I

    goto/16 :goto_0

    .line 198
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_2
        :pswitch_1
        :pswitch_3
    .end packed-switch
.end method

.method public openMenu()V
    .locals 1

    .prologue
    .line 345
    const/4 v0, 0x0

    iput v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    .line 346
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    invoke-virtual {p0, v0}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    .line 347
    return-void
.end method

.method public scrollTo(II)V
    .locals 0
    .param p1, "x"    # I
    .param p2, "y"    # I

    .prologue
    .line 278
    invoke-super {p0, p1, p2}, Landroid/view/ViewGroup;->scrollTo(II)V

    .line 279
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->postInvalidate()V

    .line 280
    return-void
.end method

.method protected snapToDestination()V
    .locals 4

    .prologue
    .line 327
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v2

    if-nez v2, :cond_0

    .line 334
    :goto_0
    return-void

    .line 330
    :cond_0
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2}, Landroid/view/View;->getWidth()I

    move-result v0

    .line 331
    .local v0, "screenWidth":I
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v2

    add-int/2addr v2, v0

    div-int/lit8 v3, v0, 0x2

    add-int/2addr v2, v3

    div-int v1, v2, v0

    .line 333
    .local v1, "whichScreen":I
    invoke-virtual {p0, v1}, Lcom/example/zsccpsapp/SlideMenu;->snapToScreen(I)V

    goto :goto_0
.end method

.method protected snapToScreen(I)V
    .locals 9
    .param p1, "whichScreen"    # I

    .prologue
    const/4 v2, 0x0

    .line 307
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->enableChildrenCache()V

    .line 309
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getChildCount()I

    move-result v0

    add-int/lit8 v0, v0, -0x1

    invoke-static {p1, v0}, Ljava/lang/Math;->min(II)I

    move-result v0

    invoke-static {v2, v0}, Ljava/lang/Math;->max(II)I

    move-result p1

    .line 310
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    if-eq p1, v0, :cond_1

    const/4 v6, 0x1

    .line 312
    .local v6, "changingScreens":Z
    :goto_0
    iput p1, p0, Lcom/example/zsccpsapp/SlideMenu;->mNextScreen:I

    .line 314
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getFocusedChild()Landroid/view/View;

    move-result-object v7

    .line 315
    .local v7, "focusedChild":Landroid/view/View;
    if-eqz v7, :cond_0

    if-eqz v6, :cond_0

    .line 316
    iget v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mCurrentScreen:I

    invoke-virtual {p0, v0}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    if-ne v7, v0, :cond_0

    .line 317
    invoke-virtual {v7}, Landroid/view/View;->clearFocus()V

    .line 320
    :cond_0
    add-int/lit8 v0, p1, -0x1

    invoke-virtual {p0, v2}, Lcom/example/zsccpsapp/SlideMenu;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/View;->getWidth()I

    move-result v1

    mul-int v8, v0, v1

    .line 321
    .local v8, "newX":I
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v0

    sub-int v3, v8, v0

    .line 322
    .local v3, "delta":I
    iget-object v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mScroller:Landroid/widget/Scroller;

    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->getScrollX()I

    move-result v1

    invoke-static {v3}, Ljava/lang/Math;->abs(I)I

    move-result v4

    mul-int/lit8 v5, v4, 0x2

    move v4, v2

    invoke-virtual/range {v0 .. v5}, Landroid/widget/Scroller;->startScroll(IIIII)V

    .line 323
    invoke-virtual {p0}, Lcom/example/zsccpsapp/SlideMenu;->invalidate()V

    .line 324
    return-void

    .end local v3    # "delta":I
    .end local v6    # "changingScreens":Z
    .end local v7    # "focusedChild":Landroid/view/View;
    .end local v8    # "newX":I
    :cond_1
    move v6, v2

    .line 310
    goto :goto_0
.end method

.method public unlock()V
    .locals 1

    .prologue
    .line 355
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/example/zsccpsapp/SlideMenu;->mLocked:Z

    .line 356
    return-void
.end method
